<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj={
            name:'zhangdaxin',
            age:21,
            detail:{
                height:180,
            }
        }
        let {name}=obj;  //右边是对象左边就要是对象，右边是数组左边就要是数组
        console.log(name); //zhangdaxin

        // let {height}=obj;
        // console.log(height);  //undefined

        let {detail:{height}}=obj;
        // console.log(detail);//报错
        // console.log(detail.height);//报错
        console.log(height);  //180

        let [a,b,c,[d,[e]]]=[1,2,3,[4,[5]]];
        console.log(a);  //1
        console.log(b);  //2
        console.log(c);  //3
        console.log(d);  //4
        console.log(e);  //5
    </script>
</body>
</html>